<template>
	<view>
		<view class="list_box">
			<u-checkbox-group size="40" active-color="#E34305" shape="circle">
				<view class="info" v-for="(item,index) in list" :key="index">
					<u-checkbox v-model="item.checked" :name="item.id"></u-checkbox>
					
					<view class="info_right">
						<view>
							<text v-if="item.plot">{{item.plot.name}}</text>
							<text v-if="item.room">{{item.room.name}}</text>
						</view>
						<view class="f_c_s time">
							<view>{{item.users.name}}</view>
							<view>{{item.users.mobile}}</view>
						</view>
					
						<view class="f_c_s time">
							<view>缴费月份:{{item.timeText}}</view>
							<view class="money">￥{{item.money}}</view>
						</view>
					
						<view class="time">缴费时间:{{item.createtime}}</view>
					
						<!-- <view class="btn_box">
							<view class="btn" v-if="item.is_kp==1">申请开票</view>
						</view> -->
					</view>
					
				</view>
			</u-checkbox-group>

		
		</view>

		<view class="bitmap" v-if="emptyShow">
			<image :src="none" mode="aspectFit"></image>
			<view class="gray_font fs-13">
				暂无可开票订单
			</view>
		</view>

		<view class="bottom_box">申请开票</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				params: {
					page: 1,
					limit: 10,
					status: 0
				},
				list: [],
				total: 0,
				emptyShow: false,
				none: ''
			}
		},
		onShow() {
			this.getList();
		},
		onLoad(e) {
			this.none = this.$imgUrl + 'assets/img/none_order.png';
		},
		methods: {
			getList() {
				this.params.page = 1;
				this.$get(this.$api.jfKp, this.params, res => {
					let data = res.data;

					if (!data.data || data.datalength < 1) {
						this.emptyShow = true;
					} else {
						this.emptyShow = false;
					}

					this.list = data.data;
					this.total = data.data.length;
				});
			},
			onReachBottom() {
				if (this.list.length < this.total) {
					this.params.page++;
					this.$get(this.$api.jfKp, this.params, res => {
						let data = res.data;
						data.data.data.forEach(ress => {
							this.list.push(ress);
						});
					});
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-tab-item {
		background-color: transparent !important;
		font-size: 30rpx !important;
	}
	/deep/ .u-checkbox__label{
		margin-left:0 !important;
		margin-right:8rpx !important;
	}

	.list_box {
		box-sizing: border-box;
		padding: 0 20rpx;
	}

	.info {
		margin-top: 30rpx;
         
		display: flex;
		align-items: center;

	}

	.info_right {
		background-color: white;
		border-radius: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		width:95%;
	}


	.red {
		color: red;
	}


	.time {
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.money {
		font-size: 32rpx;
		color: red;
		font-weight: bold;
		margin-left: 20rpx;
	}

	.bottom {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		box-sizing: border-box;
		padding: 20rpx 20rpx;
	}

	.btn {
		box-sizing: border-box;
		padding: 8rpx 25rpx;
		border: 1rpx solid black;
		font-size: 26rpx;
		border-radius: 25rpx;
		margin-left: 20rpx;
	}

	.btn_red {
		border: 1rpx solid red;
		color: red;
	}

	.bitmap {
		margin-top: 10vh;
		text-align: center;
	}

	.f_s {
		display: flex;

		justify-content: space-between;
	}

	.f_c_s {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.btn_box {
		margin-top: 10rpx;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.bottom_box {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		box-sizing: border-box;
		padding: 35rpx 0;
		text-align: center;
		color: white;
		background-color: #E34305;
		font-size: 26rpx;
	}
</style>